package com.cnebula.dataprocess.task.demo;

import org.apache.rocketmq.spring.starter.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.starter.core.RocketMQListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.google.gson.Gson;

@Service
@RocketMQMessageListener(topic = "hive_data_process_new", consumerGroup = "mysql_task_consumer_group_new")
public class TaskConsumer implements RocketMQListener<MainTaskResult>{
	
	private static final Logger log = LoggerFactory.getLogger(TaskConsumer.class);

	private Gson gson = new Gson();

	@Override
	public void onMessage(MainTaskResult arg0) {
		log.info(gson.toJson(arg0));
	}

}
